//:C10:CollectingParameterDemo.cpp
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class CollectingParaemter : public vector<string>{};
class Filler
{
public:
    void f(CollectingParaemter& cp)
    {
        cp.push_back("accumulating");
    }

    void g(CollectingParaemter& cp)
    {
        cp.push_back("items");
    }

    void h(CollectingParaemter& cp)
    {
        cp.push_back("as we go");
    }
};

int main(void)
{
    Filler filler;
    CollectingParaemter cp;
    filler.f(cp);
    filler.g(cp);
    filler.h(cp);

    vector<string>::iterator it = cp.begin();
    while(it != cp.end())
    {
        cout << *it++ << " ";
    }
    cout << endl;
}